﻿Imports System.Windows.Forms.DataVisualization.Charting

Public Class DCoordinateTransform
    Private Sub 导入ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 导入ToolStripMenuItem.Click
        OpenFile()
        If DataStr Is Nothing Then
            Exit Sub
        End If
        DataGridView1.DataSource = GetDataGrid()
        TextBox1.Text = a
        TextBox2.Text = mf
        TextBox3.Text = L0
        TextBox4.Text = B0
    End Sub

    Private Sub 计算ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 计算ToolStripMenuItem.Click
        If DataStr Is Nothing Then
            MsgBox("请先导入数据", 64, "警告")
            Exit Sub
        End If
        CalAll()
        TextBox5.Text = DPotModule.Report()
        CmputRes = TextBox1.Text
        TabControl1.SelectedTab = TabPage2
    End Sub

    Private Sub 绘图ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 绘图ToolStripMenuItem.Click
        If TextBox5.Text = "" Then
            MsgBox("请先计算", 64, "警告")
            Exit Sub
        End If
        DPotModule.Draw(Chart1)
        TabControl1.SelectedTab = TabPage3
    End Sub

    Private Sub 数据ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 数据ToolStripMenuItem.Click
        TabControl1.SelectedTab = TabPage1
    End Sub

    Private Sub 报告ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 报告ToolStripMenuItem.Click
        TabControl1.SelectedTab = TabPage2
    End Sub

    Private Sub 绘图ToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles 绘图ToolStripMenuItem1.Click
        TabControl1.SelectedTab = TabPage3
    End Sub

    Private Sub 保存报告ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 保存报告ToolStripMenuItem.Click
        If TextBox5.Text = "" Then
            MsgBox("请先计算", 64, "警告")
            Exit Sub
        End If
        CmputRes = TextBox5.Text
        SaveFile()
    End Sub

    Private Sub 退出ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles 退出ToolStripMenuItem.Click
        If Not MsgBox("确认退出?", vbQuestion + vbOKCancel, "提示") = MsgBoxResult.Cancel Then
            Application.Exit()
        End If
    End Sub
End Class